﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title></title>
</head>
<body>
	<form id="form1" runat="server">
	<t:Manager runat="server">
		<Includes>
			<t:StyleFileInclude Src="~/Res/CSS/Main.css" />
			<t:ScriptFileInclude Src="GroupedRepeater.js" />
		</Includes>
		<Scenarios>
			<t:PostScenario runat="server" ID="ps" CausesValidation="false" PostControlIds="chk0, chk1">
				<PostControls>
				</PostControls>
				<ReturnControls>
					<t:ControlReference runat="server" ControlId="rpt" Value="false" Properties="Groupings" />
				</ReturnControls>
			</t:PostScenario>
			<t:PostScenario runat="server" ID="psFlip" CausesValidation="false">
				<ReturnControls>
					<t:ControlReference runat="server" ControlId="rpt" Value="false" Properties="Groupings" />
				</ReturnControls>
			</t:PostScenario>
			<t:PostScenario runat="server" ID="psGenerate" CausesValidation="false" PostControlIds="txtNumRecords"
				ReturnControlIds="rpt">
			</t:PostScenario>
		</Scenarios>
	</t:Manager>
	<div>
		<div>
			<h1>
				Grouped Repeater</h1>
			<div>
				<t:Label runat="server" ID="lblNumRecords" For="txtNumRecords" Text="Number of records" />
				<t:TextBox runat="server" ID="txtNumRecords" Value="100" />
				<t:Button runat="server" ID="btnGenerate" Text="Generate">
					<Click PostScenarioId="psGenerate" OnServer="btnGenerate_Click" />
				</t:Button>
			</div>
			<%--ParseRenderedItems-Client="rpt_ParseRenderedItems"--%>
			<t:Label runat="server" ID="lbl0" For="chk0" Text="Group 1 (A):" />
			<t:CheckBox runat="server" ID="chk0">
				<ValueChanged OnServer="chk_ValueChanged" PostScenarioId="ps" />
			</t:CheckBox>
			<br />
			<t:Label runat="server" ID="lbl1" For="chk1" Text="Group 2 (B):" />
			<t:CheckBox runat="server" ID="chk1">
				<ValueChanged OnServer="chk_ValueChanged" PostScenarioId="ps" />
			</t:CheckBox>
			<br />
			<t:Button runat="server" ID="btnFlip" Text="Flip">
				<Click PostScenarioId="psFlip" OnServer="btnFlip_Click" />
			</t:Button>
			<t:GroupedRepeater runat="server" ID="rpt">
				<Header>
					<Template>
						<div itemscontainer="1">
					</Template>
				</Header>
				<Groupings>
					<t:RepeaterGrouping Fields="A">
						<Bind Client="rpt_G_A_Bind" />
						<Header>
							<Template>
								<div class="group_a" style="background: red;">
									A:
									<t:Label runat="server" ID="lblA" Data-Field="0.A" />
									<br />
									Total:
									<t:Label runat="server" ID="lblTotal" />
									<br />
									<ul itemscontainer="1">
							</Template>
						</Header>
						<Footer>
							<Template>
								</ul></div>
							</Template>
						</Footer>
					</t:RepeaterGrouping>
					<t:RepeaterGrouping Fields="B">
						<Bind Client="rpt_G_B_Bind" />
						<Header>
							<Template>
								<li class="group_b" style="background: green;">B:
									<t:Label runat="server" ID="lblB" Data-Field="0.B" />
									<br />
									Total:
									<t:Label runat="server" ID="lblTotal" />
									<br />
									<ul itemscontainer="1">
							</Template>
						</Header>
						<Footer>
							<Template>
								</ul> </li>
							</Template>
						</Footer>
					</t:RepeaterGrouping>
				</Groupings>
				<ViewItem>
					<Template>
						<li class="item" style="background: yellow;">C:
							<t:Label runat="server" ID="lblC" Data-Field="C" />
						</li>
					</Template>
				</ViewItem>
				<Footer>
					<Template>
						</div>
					</Template>
				</Footer>
			</t:GroupedRepeater>
		</div>
	</div>
	</form>
</body>
</html>
